using UnityEngine;
using Unity.Game.ElisAdvance.ElisScript;
using System;
using System.Reflection;

public class ElisPlayerKeyPressEvent : MonoBehaviour
{

    private float horiztantlKey;
    ElisActiveObject activeObject;

    // Start is called before the first frame update
    void Start()
    {
        activeObject = GetComponent<ElisActiveObject>();
    }

    // Update is called once per frame
    void Update()
    {
        PlayerKeyPressEvent();
        Type procType = Type.GetType("Unity.Game.ElisAdvance.ElisScript." + ElisStateTable.getString(activeObject.getState()));
        if (procType != null)
        {
            MethodInfo method = procType.GetMethod("onFixedProc");
            if (method != null)
                method.Invoke(null, new object[] { activeObject, horiztantlKey });
        }
    }

    private void FixedUpdate()
    {


 
    }

    

    private void PlayerKeyPressEvent()
    {
        horiztantlKey = KeyPressEvent.HorizontalKey();
    }
}
